package com.ruoyi.web.controller.shopping.backend;

import com.github.pagehelper.PageInfo;
import com.ruoyi.system.domain.shopping.dto.CollectDto;
import com.ruoyi.system.domain.shopping.vo.OrderVo;
import com.ruoyi.system.service.shopping.CollectService;
import com.ruoyi.system.view.common.ResultList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.ruoyi.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/backend/shopping/collect")
public class CollectController {
    @Autowired
    private CollectService collectService;
    @GetMapping("/list")
    public ResultList<List<CollectDto>> list(Integer userId){
        startPage();
        List<CollectDto> collectDtos = collectService.selectCollectDtoListByUserId(userId);
        return ResultList.success(collectDtos, (int) new PageInfo(collectDtos).getTotal(),"查询成功");
    }
}
